return _sameMonth(dateA, dateB) && (dateA.getDate() == dateB.getDate());
}
+function _isToday(date) {
+ return _sameDay(new Date(), date);
+}
+
function _isWorkDay(date) {
/* Translators: Enter 0-6 (Sunday-Saturday) for non-work days. Examples: "0" (Sunday) "6" (Saturday) "06" (Sunday and Saturday). */
let days = C_('calendar-no-work', "06");
return false;
},
- _isToday: function() {
- let today = new Date();
- return _sameDay(this._date, today);
- },
-
_shouldShow: function() {
return !this.empty;
},
},
_updateTitle: function() {
- let now = new Date();
- if (_sameDay(this._date, now)) {
+ if (_isToday(this._date)) {
this._title.label = _("Events");
return;
}
let dayFormat;
+ let now = new Date();
if (_sameYear(this._date, now))
/* Translators: Shown on calendar heading when selected day occurs on current year */
dayFormat = Shell.util_translate_time_string(NC_("calendar heading",
},
_shouldShow: function() {
- return !this.empty || !this._isToday();
+ return !this.empty || !_isToday(this._date);
},
_sync: function() {
},
_shouldShow: function() {
- return !this.empty && this._isToday();
+ return !this.empty && _isToday(this._date);
},
_sync: function() {
},
_sync: function() {
- let isToday = _sameDay(this._date, new Date());
+ let isToday = _isToday(this._date);
if (isToday && this._icon.gicon == this._todayIcon)
return;
if (!isToday && this._icon.gicon == this._otherIcon)